import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: require('@/components/Layout').default,
      children: [
        {
          path: '/',
          name: 'home',
          component: require('@/views/home/Index').default
        },
        {
          path: '/source/list',
          name: 'source-list',
          component: require('@/views/source/List').default
        },
        {
          path: '/source/add',
          name: 'source-add',
          component: require('@/views/source/Add').default
        },
        {
          path: '/source/:id',
          name: 'source-detail',
          props: true,
          component: require('@/views/source/Detail').default
        },
        {
          path: '/source/edit/:id',
          name: 'source-edit',
          props: true,
          component: require('@/views/source/Edit').default
        },
        {
          path: '/novel/list',
          name: 'novel-list',
          component: require('@/views/novel/List').default
        },
        {
          path: '/novel/edit/:id',
          name: 'novel-edit',
          props: true,
          component: require('@/views/novel/Edit').default
        },
        {
          path: '/novel/chapter',
          name: 'novel-chapter',
          component: require('@/views/novel/Chapter').default
        },
        {
          path: '/novel/:id',
          props: true,
          name: 'novel-detail',
          component: require('@/views/novel/Detail').default
        },    
      ]
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
